var currentPage = 1;//当前页码
var pageSize = 10;//每页显示的数据量
var totalCount = 0;//总条数
var totalPage = 1;//总页码
//人事查询抓值
var fileCoding = "";
var checkStatus = "";
var fstatus = "";
var startDate = "";
var endDate = "";


//查询方法
function chaxundefangfa() {
	//防止出现2/1的情况
	currentPage = 1;

	fileCoding = $(".fileCoding").val();
	checkStatus = $(".checkStatus").val();
	fstatus = $(".fstatus").val();
	startDate = $(".startDate").val();
	endDate = $(".endDate").val();
	// alert(fileCoding);
	// alert(checkStatus);
	// alert(fstatus);
	// alert(startDate);
	// alert(endDate);
	//调取参数
	let joinA = {
		fileCoding : fileCoding,
		checkStatus : checkStatus,
		fstatus : fstatus,
		startDate : startDate,
		endDate : endDate,
		currentPage: currentPage,
		pageSize: pageSize
	}
	//console.log(joinA)
	//加载数据
	$.ajaxSettings.async = false;
	$.getJSON("/renshichaxun",joinA,function (dataA) {
		console.log(dataA)
		//总条数
		totalCount = dataA.total;
		//总页数
		totalPage = dataA.pages;
		//alert(totalCount);
		//获取回调后渲染数据
		//清空
		$(".table-page tr:gt(0) td").html("&nbsp;");
		$(dataA.list).each(function (i, v) {
			//console.log(v);
			//所属部门
			let suoshu = "";
			if(v.department == 9){
				suoshu = "产品设计中心";
			}else if(v.department == 10){
				suoshu = "平台研发中心";
			}else if(v.department == 11){
				suoshu = "人力资源中心";
			}else if(v.department == 12){
				suoshu = "财务部";
			}else if(v.department == 8){
				suoshu = "质量管理部";
			}else if(v.department == 7){
				suoshu = "产品管理部";
			}else if(v.department == 6){
				suoshu = "区域市场发展三部";
			}else if(v.department == 5){
				suoshu = "区域市场发展二部";
			}else if(v.department == 4){
				suoshu = "区域市场发展一部";
			}else if(v.department == 3){
				suoshu = "职业教育研究院";
			}else if(v.department == 2){
				suoshu = "教育产品发展部";
			}else if(v.department == 1){
				suoshu = "总裁办";
			}else{
				suoshu = "啥也不是！";
			}
			//职位
			let zhiwei = "";
			if(v.jobTitle == 1){
				zhiwei = "技术总监";
			}else if(v.jobTitle == 2){
				zhiwei = "财务主管";
			}else if(v.jobTitle == 3){
				zhiwei = "技术培训师";
			}else{
				alert("请联系管理员添加信息！");
			}
			$(".table-page").find("tr").eq(i + 1).find("td").eq(0).text(v.fileCoding);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(1).text(v.name);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(2).text(v.sex);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(3).text(suoshu);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(4).text(zhiwei);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(5).text(v.filecreatedDate);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(6).text(v.checkStatus);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(7).text(v.fstatus);
			if(v.fstatus == "已删除"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<button type="button" class="layui-btn layui-btn-warm" onclick="renshishanchuhuifu('+v.id+')">删除恢复</button>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-danger layui-btn-normal" onclick="renshiyongjiushanchu('+v.id+',this)">永久删除</button>' +
					'</div>');
			}else if(v.checkStatus == "起草"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "审核中"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'</div>');
			}else if(v.checkStatus == "驳回"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "审核通过"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "变更通过"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "变更" || v.checkStatus == "变更审核中"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else {
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}
		})
	})
	$.ajaxSettings.async = true;

	//以下判断防止“0数据”，出现1/0的情况！收尾工作
	if (totalCount == 0) {
		totalPage = 1;
		$(".showPage").text(currentPage + "/" + totalPage);
		alert("抱歉，未找到符合条件的数据！");
	}
	//调用展示页码
	showPage()
}
//核心加载表查询
function fenyejiazai() {
	fileCoding = $(".fileCoding").val();
	checkStatus = $(".checkStatus").val();
	fstatus = $(".fstatus").val();
	startDate = $(".startDate").val();
	endDate = $(".endDate").val();
	// alert(fileCoding);
	// alert(checkStatus);
	// alert(fstatus);
	// alert(startDate);
	// alert(endDate);
	//调取参数
	let joinA = {
		fileCoding : fileCoding,
		checkStatus : checkStatus,
		fstatus : fstatus,
		startDate : startDate,
		endDate : endDate,
		currentPage: currentPage,
		pageSize: pageSize
	}
	//console.log(joinA)
	//加载数据
	$.ajaxSettings.async = false;
	$.getJSON("/renshichaxun",joinA,function (dataA) {
		console.log(dataA)
		//总条数
		totalCount = dataA.total;
		//总页数
		totalPage = dataA.pages;
		//alert(totalCount);
		//获取回调后渲染数据
		//清空
		$(".table-page tr:gt(0) td").html("&nbsp;");
		$(dataA.list).each(function (i, v) {
			//console.log(v);
			//所属部门
			let suoshu = "";
			if(v.department == 9){
				suoshu = "产品设计中心";
			}else if(v.department == 10){
				suoshu = "平台研发中心";
			}else if(v.department == 11){
				suoshu = "人力资源中心";
			}else if(v.department == 12){
				suoshu = "财务部";
			}else if(v.department == 8){
				suoshu = "质量管理部";
			}else if(v.department == 7){
				suoshu = "产品管理部";
			}else if(v.department == 6){
				suoshu = "区域市场发展三部";
			}else if(v.department == 5){
				suoshu = "区域市场发展二部";
			}else if(v.department == 4){
				suoshu = "区域市场发展一部";
			}else if(v.department == 3){
				suoshu = "职业教育研究院";
			}else if(v.department == 2){
				suoshu = "教育产品发展部";
			}else if(v.department == 1){
				suoshu = "总裁办";
			}else{
				suoshu = "啥也不是！";
			}
			//职位
			let zhiwei = "";
			if(v.jobTitle == 1){
				zhiwei = "技术总监";
			}else if(v.jobTitle == 2){
				zhiwei = "财务主管";
			}else if(v.jobTitle == 3){
				zhiwei = "技术培训师";
			}else{
				alert("请联系管理员添加职位信息！");
			}
			$(".table-page").find("tr").eq(i + 1).find("td").eq(0).text(v.fileCoding);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(1).text(v.name);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(2).text(v.sex);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(3).text(suoshu);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(4).text(zhiwei);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(5).text(v.filecreatedDate);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(6).text(v.checkStatus);
			$(".table-page").find("tr").eq(i + 1).find("td").eq(7).text(v.fstatus);
			if(v.fstatus == "已删除"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<button type="button" class="layui-btn layui-btn-warm" onclick="renshishanchuhuifu('+v.id+')">删除恢复</button>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-danger layui-btn-normal" onclick="renshiyongjiushanchu('+v.id+',this)">永久删除</button>' +
					'</div>');
			}else if(v.checkStatus == "起草"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "审核中"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'</div>');
			}else if(v.checkStatus == "驳回"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "审核通过"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "变更通过"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else if(v.checkStatus == "变更" || v.checkStatus == "变更审核中"){
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}else {
				$(".table-page").find("tr").eq(i + 1).find("td").eq(8).html('<div class="layui-btn-group">' +
					'<a href="/renshifuhe/' + v.id + '" class="layui-btn layui-btn-normal">' + '复核' + '</a>' +
					'<a href="/renshibiangeng/' + v.id + '" class="layui-btn  layui-btn-normal">' + '变更' + '</a>' +
					'<a href="/renshimingxi/' + v.id + '" class="layui-btn layui-btn-normal">' + '明细' + '</a>' +
					'<button type="button" class="layui-btn layui-btn-normal" onclick="renshishanchu(' + v.id + ',\'' + v.checkStatus + '\',\'' + v.fstatus + '\')">删除</button>' +
					'</div>');
			}
		})
	})
	$.ajaxSettings.async = true;

	//以下判断防止“0数据”，出现1/0的情况！收尾工作
	if (totalCount == 0) {
		totalPage = 1;
		$(".showPage").text(currentPage + "/" + totalPage);
		alert("抱歉，未找到符合条件的数据！");
	}
	//调用展示页码
	showPage()
}

//展示页码
function showPage() {
	$(".showPage").text("第" + currentPage + "页 / 共" + totalPage + "页");
}

//下一页
function next() {
	// alert("下一页");
	currentPage++;
	//alert(currentPage);
	if (currentPage > totalPage) {
		currentPage = totalPage;
		return;
	}
	fenyejiazai();
	// alert("下一页")
}


//上一页
function prev() {
	currentPage--;
	if (currentPage < 1) {
		currentPage = 1;
		return;
	}
	fenyejiazai();
}

//首页
function start() {
	currentPage = 1;
	fenyejiazai();
}

//尾页
function end() {
	currentPage = totalPage;
	fenyejiazai();
}


// 档案登记跳转
function dangandengji() {
	location.href="renshidengji";
}

// //档案复核跳转
// function renshifuhe(id){
// 	$.ajaxSettings.async = false;
// 	let jsonA = {
// 		id : id
// 	}
// 	$.getJSON("renshifuhechaxun", jsonA, function (dataA) {
// 		return ;
// 	}
// 	$.ajaxSettings.async = true;
// }

// //档案变更跳转
// function renshibiangeng(){
// 	location.href="renshibiangeng";
// }
//
// //档案修改跳转
// function renshixiugai(){
// 	location.href="renshixiugai";
// }
//
// //档案明细跳转
// function renshimingxi(){
// 	location.href="renshimingxi";
// }

//档案删除
function renshishanchu(id,checkStatus,fstatus) {
	//alert(id);
	//alert(checkStatus);
	if(checkStatus == "审核中"){
		alert("审核中的不可删除，请联系管理员！");
		return;
	}
	layer.alert('您确定要删除吗', {
		skin: 'layui-layer-molv' //样式类名  自定义样式
		,closeBtn: 1    // 是否显示关闭按钮
		,anim: 1 //动画类型
		,icon: 6    // icon
		,btn: ['确定','取消'] //按钮
		,area: ['300px', '180px']
		,yes:function () {
			let shann = "已删除";
			let jsonA = {
				id: id,
				shann :shann,
				fstatus : fstatus
			}
			$.ajaxSettings.async = false;
			$.getJSON("renshishanchu", jsonA, function (dataA) {
				if (dataA == true) {
					layer.msg("删除成功！");
					// location.href = "renshiwelcome";
					fenyejiazai();
				}else{
					alert("删除失败！");
					return;
				}
			})
			$.ajaxSettings.async = true;
		}
		,btn2:function () {
			layer.close();
		}
	});

	//老方法
	// let a = confirm("您确定要删除吗？");
	// let shann = "已删除";
	// //alert(fstatus);
	// if(a==true) {
	// 	let jsonA = {
	// 		id: id,
	// 		shann :shann,
	// 		fstatus : fstatus
	// 	}
	// 	//console.log(jsonA)
	// 	$.ajaxSettings.async = false;
	// 	$.getJSON("renshishanchu", jsonA, function (dataA) {
	// 		if (dataA == true) {
	// 			layer.msg("删除成功！");
	// 			// location.href = "renshiwelcome";
	// 			fenyejiazai();
	// 		}else{
	// 			alert("删除失败！");
	// 			return;
	// 		}
	// 	})
	// 	$.ajaxSettings.async = true;
	// }else{
	// 	return;
	// }
}

//人事永久删除
function renshiyongjiushanchu(id,thisA) {
	//alert(id);

	layer.alert('您确定要彻底删除吗？', {
		skin: 'layui-layer-molv' //样式类名  自定义样式
		, closeBtn: 1    // 是否显示关闭按钮
		, anim: 1 //动画类型
		, icon: 6    // icon
		, btn: ['确定', '取消'] //按钮
		, area: ['300px', '180px']
		, yes: function () {
			let javaA = {
				id: id
			}
			$.ajaxSettings.async = false;
			$.get("/renshiyongjiushanchu", javaA, function (dataA) {
				if (dataA == "true") {
					layer.msg("永久删除成功！");
					// alert("永久删除成功！");
					$(thisA).parents("tr").remove();
					fenyejiazai();
				} else {
					alert("删除失败！");
					return;
				}
			})
			$.ajaxSettings.async = true;
		}
		, btn2: function () {
			layer.close();
		}
	});

}
//老方法
// 	let a = confirm("您确定要彻底删除吗？");
// 	let javaA = {
// 		id : id
// 	}
// 	if (a==true){
// 		$.ajaxSettings.async = false;
// 			$.get("/renshiyongjiushanchu",javaA,function (dataA) {
// 				if (dataA == "true"){
// 					alert("永久删除成功！");
// 					$(thisA).parents("tr").remove();
// 					fenyejiazai();
// 				}else{
// 					alert("删除失败！");
// 					return;
// 				}
// 			})
// 		$.ajaxSettings.async = true;
// 	}else{
// 		return;
// 	}
// }

//人事删除恢复
function renshishanchuhuifu(id) {
	//alert(id);
	let javaA = {
		id : id
	}
	$.ajaxSettings.async = false;
	$.get("/renshishanchuhuifu",javaA,function (dataA) {
		//alert(dataA);
		if (dataA == "true"){
			layer.msg("恢复成功！");
			fenyejiazai();
		}else{
			alert("恢复失败！");
			return;
		}
	})
	$.ajaxSettings.async = true;
}



//苏
function renshitianjia() {
	let department = $(".department").val();
	let fileCoding = $(".fileCoding").val();
	let jobTitle = $(".jobTitle").val();
	let changeTheType = $(".changeTheType").val();
	let phonePath = $(".phonePath").val();
	let fstatus = $(".fstatus").val();
	let name = $(".name").val();
	let sex = $(".sex").val();
	let email = $(".email").val();
	let phone = $(".phone").val();
	let address = $(".address").val();
	let idNumber = $(".idNumber").val();
	let registered = $(".registered").val();
	let politicsStatus = $(".politicsStatus").val();
	let school = $(".school").val();
	let major = $(".major").val();
	let education = $(".education").val();
	let salaaryStandard = $(".salaaryStandard").val();
	let openingBank = $(".openingBank").val();
	let cardNo = $(".cardNo").val();
	let social = $(".social").val();
	let registrant = $(".registrant").val();
	let filecreatedDate = $(".filecreatedDate").val();
	let redumes = $(".redumes").val();
	let family = $(".family").val();
	let notes = $(".notes").val();
	let resumeAttachment = $(".resumeAttachment").val();
	let checkStatus = "起草";


	if (department == null || department == "") {
		alert("请选择所属部门！")
		return;
	}
	if (fileCoding == null || fileCoding == "") {
		alert("请选择职位编码！")
		return;
	}
	if (jobTitle == null || jobTitle == "") {
		alert("请选择职位名称！")
		return;
	}
	if (fstatus == null || fstatus == "") {
		alert("请选择档案状态！")
		return;
	}
	if (name == null || name == "") {
		alert("请填写姓名！")
		return;
	}
	if (sex == null || sex == "") {
		alert("请选择性别！")
		return;
	}
	if (email == null || email == "") {
		alert("请填写邮箱！")
		return;
	}
	if (phone == null || phone == "") {
		alert("请填写手机号！")
		return;
	}
	if (address == null || address == "") {
		alert("请填写地住址！")
		return;
	}
	if (idNumber == null || idNumber == "") {
		alert("请填写身份证号！")
		return;
	}
	if (registered == null || registered == "") {
		alert("请填写户口所在地！")
		return;
	}
	if (politicsStatus == null || politicsStatus == "") {
		alert("请选择政治面貌！")
		return;
	}
	if (school == null || school == "") {
		alert("请填写学校！")
		return;
	}
	if (major == null || major == "") {
		alert("请填写专业！")
		return;
	}
	if (education == null || education == "") {
		alert("请选择学历！")
		return;
	}
	if (salaaryStandard == null || salaaryStandard == "") {
		alert("请选择薪资标准！")
		return;
	}
	if (openingBank == null || openingBank == "") {
		alert("请填写开户行！")
		return;
	}
	if (cardNo == null || cardNo == "") {
		alert("请填写银行卡号！")
		return;
	}
	if (social == null || social == "") {
		alert("请填写社保卡号！")
		return;
	}
	if (registrant == null || registrant == "") {
		alert("请填写登记人！")
		return;
	}
	if (filecreatedDate == null || filecreatedDate == "") {
		alert("请选择建档日期！")
		return;
	}
	if (redumes == null || redumes == "") {
		alert("请填写个人履历！")
		return;
	}
	if (family == null || family == "") {
		alert("请填写家庭关系信息！")
		return;
	}
	if (notes == null || notes == "") {
		alert("请填写备注信息！")
		return;
	}
	if (resumeAttachment == null || resumeAttachment == "") {
		alert("请选择简历附件！")
		return;
	}


	let jsonA = {
		department: department,
		fileCoding: fileCoding,
		jobTitle: jobTitle,
		changeTheType: changeTheType,
		phonePath: phonePath,
		fstatus: fstatus,
		name: name,
		sex: sex,
		email: email,
		phone: phone,
		address: address,
		idNumber: idNumber,
		registered: registered,
		politicsStatus: politicsStatus,
		school: school,
		major: major,
		education: education,
		salaaryStandard: salaaryStandard,
		openingBank: openingBank,
		cardNo: cardNo,
		social: social,
		registrant: registrant,
		filecreatedDate: filecreatedDate,
		redumes: redumes,
		family: family,
		notes: notes,
		resumeAttachment: resumeAttachment,
		checkStatus: checkStatus
	}
	console.log(jsonA)

	$.ajaxSettings.async = false;
	$.getJSON("/tianjiadangans", jsonA, function (dataA) {
		/*console.log("11111111111")*/
		console.log(dataA)
		if (dataA == true) {
			layer.msg("添加成功！");
			// alert("添加成功！");
			location.href = "renshiwelcome"
		} else {
			alert("添加失败！");
		}
	})
	$.ajaxSettings.async = true;

}

//职位名称传下拉框
/*
function zhiwei() {
	$(".jobTitle").empty()
	$.ajaxSettings.async=false;
	$.get("/xuan",function (data) {
		$(".jobTitle").html("<option value=\"0\">--请选择职位名称--</option>")
		$(data).each(function (i,v) {
			let q = "<option value='"+id+"'>"+posName+"</option>"
			$(".jobTitle").append(q);
		})
	},"json")
	$.ajaxSettings.async=true;
}*/


/*
照片上传在页面显示
$('#chooseImage').on('change',function(){
	var filePath = $(this).val(),         //获取到input的value，里面是文件的路径
		fileFormat = filePath.substring(filePath.lastIndexOf(".")).toLowerCase(),
		src = window.URL.createObjectURL(this.files[0]); //转成可以在本地预览的格式
	// 检查是否是图片
	if( !fileFormat.match(/.png|.jpg|.jpeg/) ) {
		error_prompt_alert('上传错误,文件格式必须为：png/jpg/jpeg');
		return;
	}
	var src = window.URL.createObjectURL(this.files[0]); //转成可以在本地预览的格式
	$('#cropedBigImg').attr('src',src);
});



function showImg(obj) {
	var files = obj.files
	// document.getElementById("imgContainer").innerHTML = getImgsByUrl(files)
	getImgsByFileReader(document.getElementById("imgContainer"), files)
}
// 使用FileReader读取file实例并显示图片
function getImgsByFileReader(el, files) {
	for (var i = 0; i < files.length; i++) {
		let img = document.createElement('img')
		img.setAttribute('style', 'width: 200px; height: 200px; margin-right: 5px;')
		el.appendChild(img)
		var reader = new FileReader()
		reader.onload = function(e) {
			img.src = e.target.result
		}
		reader.readAsDataURL(files[i])
	}
}
*/

/*
function renshixiugai() {

}*/
